package com.loeng.module.infra.controller.admin.job.vo.log;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@Schema(description = "管理后台 - 定时任务日志新增/修改 Request VO")
@Data
public class JobLogSaveReqVO {

    @Schema(description = "日志编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5959")
    private Long id;

    @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31466")
    @NotNull(message = "任务编号不能为空")
    private Long jobId;

    @Schema(description = "处理器的名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @NotEmpty(message = "处理器的名字不能为空")
    private String handlerName;

    @Schema(description = "处理器的参数")
    private String handlerParam;

    @Schema(description = "第几次执行", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "第几次执行不能为空")
    private Integer executeIndex;

    @Schema(description = "开始执行时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "开始执行时间不能为空")
    private LocalDateTime beginTime;

    @Schema(description = "结束执行时间")
    private LocalDateTime endTime;

    @Schema(description = "执行时长")
    private Integer duration;

    @Schema(description = "任务状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotNull(message = "任务状态不能为空")
    private Integer status;

    @Schema(description = "结果数据")
    private String result;

}